package cn.hxzy.controller;



import cn.hxzy.common.Result;
import cn.hxzy.entity.accreditation.TsEnterpriseCertification;
import cn.hxzy.service.TsEnterpriseCertificationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;


import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Kuizhi.Ma
 * @since 2023-06-25
 *企业认证
 */
@RestController
@CrossOrigin
@RequestMapping("/tsEnterpriseCertification")
public class TsEnterpriseCertificationController {

    @Autowired
    private TsEnterpriseCertificationService tsEnterpriseCertificationService;


//    远程调用 马奎志
    @RequestMapping("insert")
    public Result insert(@RequestBody TsEnterpriseCertification tsEnterpriseCertification){
        System.out.println(tsEnterpriseCertification);
        tsEnterpriseCertification.setApplyTime(new Date());
        boolean b = tsEnterpriseCertificationService.save(tsEnterpriseCertification);
        if (b)return Result.ok().code(102).message("管理员正在审核中");
        return Result.error().message("请重新填写信息").code(104);
    }
}

